package ssm.com.serviceImpl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import ssm.com.mapper.OrderMapper;
import ssm.com.pojo.Door;
import ssm.com.pojo.Order;
import ssm.com.service.OrderService;

import java.util.List;

@Service
public class OrderServiceImpl implements OrderService {

    @Autowired
    private OrderMapper orderMapper;

    @Override
    public List<Order> findAllOrderInfo() {
        List<Order> list = orderMapper.findAllOrderInfo();
        return list;
    }

    @Override
    public List<Order> findOrderLimit(Integer pageNum,Integer offSet) {
        List<Order> list = orderMapper.findOrderLimit(pageNum,offSet);
        return list;
    }

    @Override
    public int deleteOrderById(Integer id) {
        int row = orderMapper.deleteOrderById(id);
        return row;
    }



    @Override
    public int add(Order order) {
        int row = orderMapper.add(order);
        return row;

    }

    @Override
    public Order findOrderById(Integer id) {
        Order order = orderMapper.findOrderById(id);
        return order;
    }

    @Override
    public int doUpdate(Order order) {
        int row = orderMapper.doUpdate(order);
        return row;
    }

    @Override
    public int getCount() {
        int count = orderMapper.getCount();
        return count;
    }
}
